<template>
    <div class="page coach-page">
        <div class="banner">
            <div class="banner-image"
                 style="background-image: url('/images/training_detail_banner.jpg')">
                <span>课程详情</span>
                <p>COURSE DETAILS</p>
            </div>
        </div>
        <div class="content">
            <PlatformCrumb :back="data.name" style="    margin-top: 0;">
            </PlatformCrumb>
            <!-- 富文本区域 -->
            <div class="training-content">
                <div class="training-content-header" style="border-bottom:0;">
                    <span>{{data.name}}</span>
                </div>
                <div class="training-content-text">
                    <div v-if="data.video" class="platform-video" style="margin-bottom:20px">
                        <video width="650" :src="data.video|filtersImg" controls="controls"></video>
<!--                        <div class="play"><img src="/images/play_icon.png"></div>-->
                    </div>
                    <img class="contentimg" :src="data.imgs|filtersImg" alt="">
                    <pre v-html="data.doc"></pre>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import {getBallShowList, getCourseGet} from '../../api/api/platform.js';
    import {baseImgPath, basefile} from '@/config/env.js';
    import PlatformCrumb from "@/components/PlatformCrumb.vue";
    export default {
        components: {
            PlatformCrumb
        },
        data() {
            return {
                id: this.$route.query.id,
                data: {
                    "address": "string",
                    "banner": "string",
                    "coachId": 0,
                    "courseType": 0,
                    "createTime": "2019-07-07T23:39:20.252Z",
                    "doc": "string",
                    "grouping": 0,
                    "id": 0,
                    "imgs": "string",
                    "mechanismId": 0,
                    "money": 0,
                    "name": "string",
                    "plan": "string",
                    "status": 0,
                    "type": 0,
                    "updateTime": "2019-07-07T23:39:20.252Z",
                    "userId": 0,
                    "video": "string"
                }
            }
        },
        created() {
            this.GetDetail()
        },
        methods: {
            back() {
                this.$router.go(-1);//返回上一层
            },
            GetDetail() {
                getCourseGet({
                    "id": this.$route.query.id,
                }).then(res => {
                    this.data = res.data
                });
            },
        },
        filters: {
            filtersImg: function (img) {
                return basefile + img
            }
        }
    }
</script>

<style scoped>
    @import url("css/D-coach-training.css");

    .cur {
        cursor: pointer;
    }

    .contentimg {
        display: block;
        margin: 20px auto;
        max-width: 700px !important;
    }
</style>
